package com.xmall.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xmall.product.entity.StockLockLog;
import com.xmall.product.mapper.StockLockLogMapper;
import com.xmall.product.service.IStockLockLogService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 库存锁定日志 服务实现类
 * </p>
 *
 * @author xmall
 * @since 2023-11-21
 */
@Service
public class StockLockLogServiceImpl extends ServiceImpl<StockLockLogMapper, StockLockLog> implements IStockLockLogService {

    @Override
    public List<StockLockLog> delete(Long orderId) {
        List<StockLockLog> stockLockLogList = this.list(new QueryWrapper<StockLockLog>().eq("order_id", orderId));
        this.remove(new QueryWrapper<StockLockLog>().eq("order_id", orderId));
        return stockLockLogList;
    }
}
